<?php
session_start();
require('./include/phpsqlajax_dbinfo.php');
	
	function parseToXML($htmlStr){
		$xmlStr=str_replace("&",'&amp;',$htmlStr);
		return $xmlStr; 
	}
	
	 // Opens a connection to a MySQL server.
	$connection = mysql_connect ($server, $username, $password);
	if (!$connection) 
	{
	  die('Not connected : ' . mysql_error());
	}
	
	// Sets the active MySQL database.
	$db_selected = mysql_select_db($database, $connection);
	if (!$db_selected) 
	{
	  die ('Can\'t use db : ' . mysql_error());
	}
	
	 //Set result charset to UTF-8
	 mysql_query('SET NAMES "utf8"');
	 
	 // Update user profile
	 $query=	'UPDATE `users` SET `email`="'.$_POST['email'].'",`organization`="'.$_POST['organization'].'" 
				WHERE `username`="'.$_SESSION['username'].'"';
	mysql_query($query)or die (mysql_error());
	 
?>